<include file="Tpl/Public/admin_top.html">
<script type="text/javascript" src="{site}/Public/JScript/public.js?<?php echo time();?>"></script>
<script type="text/javascript">
 	var xmlhttp;
	if (window.ActiveXObject){
	    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
	    xmlhttp = new XMLHttpRequest();
	}
		function pop(id,val){
		   xmlhttp.open("POST", rooturl + "/index.php/admin" + url + "scblockPurview" + shtml, true);
		   xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		   xmlhttp.send("data="+id);
		   xmlhttp.onreadystatechange = function(){
		      if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
		      	var jsonObject = eval("(" + xmlhttp.responseText + ")");
			var tdiv=document.createElement("div");
			tdiv.id="popp";
			tdiv.className="form-container";
			createBg();
			tdiv.style.cssText="width:300px;height:196px;position:fixed;left:50%;top:50%;margin-left:-150px;margin-top:-98px;border:1px solid #e9e9e9;z-index:999";
			tdiv.innerHTML='<form action="__APP__/admin{url}editcblock{shtml}" method=post target="main">'+
										 '<table width=100%  cellspacing=0 cellpadding=2>'+
										 	'<tr><td colspan="2" align="right" style="color:#333;font-size:12px"><span style="cursor:pointer" onclick="closeBg(\'popp\');">关闭</span></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">名称</td><td><input type="text" name="szone" style="width:180px" value="'+jsonObject.szone+'"></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">描述</td><td><textarea name="mark" style="width:184px;height:30px;resize:none;border:1px solid #adadad">'+jsonObject.mark+'</textarea></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">icon图标</td><td><input type="text" name="icon_url" style="width:180px" placeholder="请输入url地址" value="'+jsonObject.icon_url+'"></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">序号</td><td><input type="text" name="ssort" style="width:180px" value="'+jsonObject.ssort+'"></td></tr>'+
											'<input type="hidden" name="id" value="'+id+'">'+
											'<input type="hidden" name="token" value="{token}">'+
											'<tr><td colspan=2><input type="hidden" name="sid" value='+val+'><input type="image" src="{site}/Public/images/edit.gif"></td></tr>'+
										' </table>'+
										'</form>';
					document.body.appendChild(tdiv);
				}
			}
		}
		function pop_pursue(id,name){
		   xmlhttp.open("POST", rooturl + "/index.php/admin" + url + "blockSetPurview" + shtml, true);
		   xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		   xmlhttp.send("data="+id);
		   xmlhttp.onreadystatechange = function(){
		      if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
			var tdiv=document.createElement("div");
			tdiv.id="popp_pursue";
			tdiv.className="form-container";
			createBg();
			tdiv.style.cssText="width:300px;height:200px;position:fixed;left:50%;top:50%;margin-left:-150px;margin-top:-100px;z-index:999";
			tdiv.innerHTML='<form action="__APP__/admin{url}blockSetPurviewDo{shtml}" method=post target="main">'+
										 '<table width=100%  cellspacing=0 cellpadding=2>'+
											'<tr><td align="right" style="color:#333;font-size:12px"><span style="cursor:pointer" onclick="closeBg(\'popp_pursue\');">关闭</span></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">有权限访问 '+name+' 的用户组</td></tr>'+
											'<tr><td>'+xmlhttp.responseText+'</td></tr>'+
											'<input type="hidden" name="id" value="'+id+'">'+
											'<input type="hidden" name="jumpurl" value="'+window.location.href+'">'+
											'<input type="hidden" name="token" value="{token}">'+
											'<tr><td><input type="image" src="{site}/Public/images/edit.gif"></td></tr>'+
										' </table>'+
										'</form>';
			document.body.appendChild(tdiv);
				}
			}
		}
		function add(val){
			var tdiv=document.createElement("div");
			tdiv.id="popadd";
			tdiv.className="form-container";
			createBg();
			tdiv.style.cssText="width:300px;height:166px;position:fixed;left:50%;top:50%;margin-left:-150px;margin-top:-83px;border:1px solid #e9e9e9;z-index:999";
			tdiv.innerHTML='<form action="__APP__/admin{url}addcblock{shtml}" method=post target="main">'+
										 '<table width=100%  height="160" cellspacing=0 cellpadding=2>'+
										 	'<tr><td colspan="2" align="right" style="color:#333;font-size:12px"><span style="cursor:pointer" onclick="closeBg(\'popadd\');">关闭</span></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">名称</td><td><input type="text" name="szone" style="width:180px"></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">描述</td><td><textarea name="mark" style="width:184px;height:30px;resize:none;border:1px solid #adadad"></textarea></td></tr>'+
											'<tr><td style="color:#777;font-size:15px">icon图标</td><td><input type="text" name="icon_url" style="width:180px" placeholder="请输入url地址"></td></tr>'+
											'<input type="hidden" name="token" value="{token}">'+
											'<tr><td colspan=2><input type="hidden" name="sid" value='+val+'><input type="image" src="{site}/Public/images/add.gif"></td></tr>'+
										' </table>'+
										'</form>';
			document.body.appendChild(tdiv);
		}
	</script>
	<table width=98% height="auto" cellspacing=0 cellpadding=0 border=1 style="margin:auto;border:1px solid #ccc">
		<tr>
			<td height="40" colspan="6" style="line-height:40px;background:url('{site}/Public/images/topbg.jpg')"><span style="font-size:14px;text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);color:#333;font-weight:bold;"><a style="color:#333;" href="__APP__/admin{url}block{shtml}">版块设置</a>&nbsp;&gt;&nbsp;<a style="color:#333;" href="__APP__/admin{url}sblock{url}id{url}{data3->bid}{shtml}">{data2->bzone}</a>&nbsp;&gt;&nbsp;{data3->szone}&nbsp;(子版块)</span></td>
		</tr>
		<tr>
			<td width="96" height="30" style="line-height:30px;font-size:15px;color:#222;font-weight:bold;">子版块ID</td>
			<td width="100" height="30" style="line-height:30px;font-size:15px;color:#222;font-weight:bold;">名称</td>
			<td width="265" height="30" style="line-height:30px;font-size:15px;color:#222;font-weight:bold;">描述</td>
			<td height="30" style="line-height:30px;font-size:15px;color:#222;font-weight:bold;">icon图标</td>
			<td width="49" title="排序功能&#10;用于子版块之间的排序" height="30" style="line-height:30px;font-size:15px;color:#bb6920;font-weight:bold;">排序</td>
			<td width="114" align="center"  height="30" style="line-height:30px;color:#0066cc;font-size:12px;font-family:Tahoma;"><span style="cursor:pointer" onclick="add({data3->id})">增加</span></td>
		</tr>
		<list>
			<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
				<td height="30" style="line-height:30px;font-size:12px;color:#555;">{data.id}</td>
				<td height="30" style="line-height:30px;font-size:12px;color:#555;">{data.szone}</td>
				<td height="30" style="line-height:30px;font-size:12px;color:#555;">
					<div style="text-overflow:ellipsis;white-space:nowrap; overflow:hidden;width:265px;">{data.mark}</div>
				</td>
				<td height="30" style="line-height:30px;font-size:12px;color:#555;">{data.icon_url}</td>
				<td height="30" style="line-height:30px;font-size:12px;color:#555;">{data.ssort}</td>
				<td align="left" height="30" style="padding-left:20px;line-height:30px;font-size:12px;color:#555;">
				<a style="color:#0066cc;font-size:12px;font-family:Tahoma;"  href="javascript:void(0)" onclick="pop_pursue({data.id},'{data.szone}')">用户组</a>&nbsp;
				<a style="color:#0066cc;font-size:12px;font-family:Tahoma;"  href="javascript:void(0)" onclick="pop({data.id},{data3->id})">修改</a>&nbsp;
				<a style="color:#0066cc;font-size:12px;font-family:Tahoma;"  href="__APP__/admin{url}delcblock{url}id{url}{data.id}{url}sid{url}{data3->id}{shtml}?token={token}" onclick="return confirm('您确定要删除?');">删除</a>
				</td>
			</tr>
		</list>
	</table>
<include file="Tpl/Public/admin_bottom.html">